const Koa=require('koa2');
const app=new Koa();

//logger
app.use((ctx,next)=>{
    console.log(`\n\n<--${ctx.method} ${ctx.url}`);
    next();
    console.log(`\n\n-->${ctx.method} ${ctx.url}`);
});

const main=ctx=>{
    ctx.throw(500);
};

app.use(main);

app.listen(3002,()=>{
    console.log('\n\nPort 3002',new Date().toLocaleTimeString());
});